import json
import threading
def json2txt(json_dir,txt_dir):
    fs=open(json_dir,'r',encoding='utf-8')
    num_lines_read_1time=1e5
    l=fs.readline()
    ft=open(json_dir.split('.json')[0]+txt_dir,'a')
    while l:
        s=l.split('"content": "')[1].strip()[:-2]
        ft.write(s+'\n')
        l=fs.readline()
    ft.close()

if __name__=="__main__":
    json2txt(json_dir='../../hard_drive/entropy/news2016zh_valid.json',txt_dir='ft.txt')